package com.qianyue.组合模式;

/**
 * 菜单项
 *
 * @author qian yue
 * @version v1.0.0
 * @since 2025/2/4 13:41
 */
public class MenuItem extends MenuComponent {
    public MenuItem(String name, int level) {
        super(name, level);
    }

    @Override
    public void print() {
        for (int i = 0; i < level; i++) {
            System.out.print("--");
        }
        System.out.println(name);
    }
}
